package com.leetcode.algorithm.y22.m08.w3;

/**
 * 334. 递增的三元子序列
 * 
 * https://leetcode.cn/problems/increasing-triplet-subsequence/
 * 
 * @author jie.deng
 *
 */
class Question0334Solution01 {

	public boolean increasingTriplet(int[] nums) {
		// 贪心
		int first = nums[0];
		int second = Integer.MAX_VALUE;

		for (int i = 1; i < nums.length; i++) {
			if (nums[i] > second) {
				return true;
			} else if (nums[i] > first) {
				second = nums[i];
			} else {
				// 
				first = nums[i];
			}
		}
		return false;
	}

}